﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using NUnit.Framework;

using NUnitResults;
using NUnitResultsTests.Mocks;

namespace NUnitResultsTests.Unit
{
    /// <summary>
    /// Tests the ResultsFile class.
    /// </summary>
    public class ResultsFileTests
    {
        /// <summary>
        /// Tests that the ResultsFile class reads the test files correctly.
        /// </summary>
        [Test]
        [TestCaseSource(typeof(NUnitResultsTests.Resources.TestCases), "GetSampleResults")]
        public void TestSample1(String resourceFile, Status status, Int32 testCaseCount, IList<ITestResult> expectedResults)
        {
            var sp = MockStreamProvider.Create(resourceFile);
            var resultsFile = new ResultFile(sp);
            var actualResults = resultsFile.ReadTestResults();

            Assert.AreEqual(expectedResults, actualResults);
        }
    }
}
